import Vue from 'vue'
import "babel-polyfill"
import Axios from './getAjax.js'

Vue.prototype.Axios=Axios;
var tok=window.localStorage.getItem('hyoaTK');
if(tok){
	Vue.prototype.Axios.axiosPro('/checkLogin',{token:tok},'post')
		.then(function(res){
			if(res.data.data.status&&res.data.data.status==='02'){
				if(window.location.pathname==='/'){
					window.location.href="/module/entry.html";
				}
			}else if(res.data.data.status==='01'){
				window.location.href="/module/login.html";
			}
		}).catch(function(err){
			window.location.href="/module/login.html";
		});
}else{
	window.location.href="/module/login.html";
}